package com.company.cloud.mall.modules.app.controller.req;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import com.company.cloud.common.bean.DataMapEntity;
import com.company.cloud.common.constant.BaseConstant.YNEnum;
import com.company.cloud.mall.constant.ShippingMethodEnum;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class OrderSaveItem {

	@ApiModelProperty(value = "收货地址")
	private Integer addrId;

	@ApiModelProperty(value = "配送方式【ShippingMethodEnum】")
	private String shippingMethod = ShippingMethodEnum.General_Shipping.getCode();

	@ApiModelProperty(value = "运费")
	private BigDecimal freight = BigDecimal.ZERO;

	@ApiModelProperty(value = "优惠码")
	private String couponCode;

//	@ApiModelProperty(value = "优惠码折扣金额")
//	private BigDecimal couponDiscountFund = BigDecimal.ZERO;
	
	@ApiModelProperty(value = "订单参数")
	private DataMapEntity orderParam;

	@ApiModelProperty(value = "用户留言")
	private String userMemo;

	@ApiModelProperty(value = "是否需要发票")
	private String isInvoice = YNEnum.NO.getCode();

	@ApiModelProperty(value = "发票类型")
	private String invoiceType;

	@ApiModelProperty(value = "发票抬头")
	private String invoiceTitle;

	@ApiModelProperty(value = "发票税号")
	private String invoiceTaxNo;

	@ApiModelProperty(value = "发票内容")
	private String invoiceContent;

	@ApiModelProperty(value = "使用人手机号码")
	private String useUserMobile;

	@ApiModelProperty(value = "使用人姓名")
	private String useUserName;

	@ApiModelProperty(value = "订单明细")
	private List<OrderSaveProductItem> items;

	public void addItem(OrderSaveProductItem item) {
		if (this.items == null) {
			this.items = new ArrayList<OrderSaveProductItem>();
		}
		if (item != null) {
			this.items.add(item);
		}
	}

}
